<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>

  <meta http-equiv="Content-Language" content="en-us">


  <title>IupGLButton</title>
  <link rel="stylesheet" type="text/css" href="../../style.css">

  <style type="text/css">
.style1 {
	font-size: large;
}
</style>

  </head>


<body>

<div id="navigation">
  
<ul>

    <li><a href="#Creation">Creation</a></li>

    <li><a href="#Attributes">Attributes</a></li>

    <li><a href="#Callbacks">Callbacks</a></li>

    <li><a href="#Notes">Notes</a></li>

    <li><a href="#Examples">Examples</a></li>

    <li><a href="#SeeAlso">See Also</a></li>

  
</ul>

</div>


<h2>IupGLButton <span class="style1">(since 3.11)</span></h2>


  
<p>
  Creates an embedded OpenGL interface element that is a 
  button. When selected, this element activates a function in the application. Its visual presentation can contain a 
  text and/or an image. It inherits from <a href="iupgllabel.html">IupGLLabel</a>. 
  It exists only inside an
<a href="iupglcanvasbox.html">IupGLCanvasBox</a>.</p>


<h3><a name="Creation">Creation</a></h3>


<pre>Ihandle* IupGLButton(const char *<strong>title</strong>); [in C]<br>iup.glbutton{[title = <strong>title</strong>: string]} -&gt; <strong>elem</strong>: ihandle [in Lua]<br>glbutton(<strong>title</strong>) [in LED]</pre>

  
<p><b>
  title</b>: Text to be shown to the user. It can be NULL. It will set the TITLE 
  attribute.<br>

  </p>

  
<p>
  <u>Returns:</u> the identifier of the 
  created element, or NULL if an error occurs.</p>


<h3><a name="Attributes">Attributes</a></h3>



<p>The 
  <strong>IupGLButton</strong> element handle all attributes defined for the
<a href="iupgllabel.html">IupGLLabel</a> control, and consequently for the
<a href="iupglsubcanvas.html">IupGLSubCanvas</a> control too.</p>


  <p><strong>BACKIMAGE</strong> (<font SIZE="3">non inheritable</font>):
  image name to be used as background. It will be zoomed to fill the background 
  (it does not includes the border). Use
	<a href="../func/iupsethandle.html">IupSetHandle</a> or
	<a href="../func/iupsetattributehandle.html">IupSetAttributeHandle</a> to 
	associate an image to a name. See also
	<a href="../elem/iupimage.html">IupImage</a>. (since 3.11.2)</p>
<p><strong>BACKIMAGEHIGHLIGHT</strong> (<font SIZE="3">non inheritable</font>): 
background image name of the element in highlight state. If it is not defined 
then the BACKIMAGE is used. (since 3.11.2)</p>
  <p><strong>BACKIMAGEINACTIVE</strong> (<font SIZE="3">non inheritable</font>): 
  background image name of the element when inactive. If it is not defined then the 
  BACKIMAGE 
  is used and its colors will be replaced by a modified version creating the 
  disabled effect. (since 3.11.2)</p>

  
<p><strong>BACKIMAGEPRESS </strong>(<font size="3">non inheritable</font>): 
background image 
name of the element in pressed state. If it is not defined then the BACKIMAGE is 
used.(since 3.11.2)</p>

  <p><a href="../attrib/iup_fgcolor.html">FGCOLOR</a>: Text color. Can have an 
  alpha component. Default: &quot;0 0 
  0&quot;. If TITLE and IMAGE are both not defined then the button will show a 
  color in a rectangle using this attribute (since 3.15).</p>


  <p><strong>FRONTIMAGE</strong> (<font SIZE="3">non inheritable</font>):
  image name to be used as foreground. It will be zoomed to fill the foreground 
  (it does not includes the border). The foreground has the same are as the 
  background, but it is drawn at last. Use
	<a href="../func/iupsethandle.html">IupSetHandle</a> or
	<a href="../func/iupsetattributehandle.html">IupSetAttributeHandle</a> to 
	associate an image to a name. See also
	<a href="../elem/iupimage.html">IupImage</a>. (since 3.11.2)</p>
<p><strong>FITTOBACKIMAGE</strong> (<font size="3">non inheritable</font>): 
enable the natural size to be computed from the BACKIMAGE. If BACKIMAGE is not 
defined will be ignored. When set to Yes it will set BORDERWIDTH to 0. Can be 
Yes or No. Default: No.&nbsp; (since 3.11.2)</p>
<p><strong>FRONTIMAGEHIGHLIGHT</strong> (<font SIZE="3">non inheritable</font>): 
foreground image name of the element in highlight state. If it is not defined 
then the FRONTIMAGE is used. (since 3.11.2)</p>
  <p><strong>FRONTIMAGEINACTIVE</strong> (<font SIZE="3">non inheritable</font>): 
  foreground image name of the element when inactive. If it is not defined then the 
  FRONTIMAGE 
  is used and its colors will be replaced by a modified version creating the 
  disabled effect. (since 3.11.2)</p>

  
<p><strong>FRONTIMAGEPRESS </strong> (<font size="3">non inheritable</font>): 
foreground image 
name of the element in pressed state. If it is not defined then the FRONTIMAGE is 
used.(since 3.11.2)</p>


<h3><a name="Callbacks">Callbacks</a></h3>


<p>The 
  <strong>IupGLButton</strong> element handle all callbacks defined for the
<strong>IupGLSubCanvas</strong> control.</p>
<blockquote>
  <hr>
</blockquote>

<p><a href="../call/iup_action.html">ACTION</a>:
  Action generated when the button 1 (usually 
  left) is selected. This callback is called only after the mouse is released and when it is released inside the 
  button area.</p>

  
    
<pre>int function(Ihandle*<strong> ih</strong>); [in C]<br><strong>elem</strong>:action() -&gt; (<strong>ret</strong>: number) [in Lua]</pre>

    
<p class="info"><strong>ih</strong>:
  identifier of the element that activated the 
  event.</p>

<p class="info"><u>Returns</u>: IUP_CLOSE will be processed.</p>

  
<h3><a name="Notes">Notes</a></h3>


<p>The difference between an <strong>IupGLButton</strong> and an <strong>
IupGLLabel</strong> is the border (controlled by <strong>IupGLSubCanvas</strong> 
attributes BORDERWIDTH and BORDERCOLOR), the change in background color for 
state feedback (controlled by PRESSCOLOR and HLCOLOR attributes), and the 
callback to notify the application.</p>
<p>The natural size if the same as a <strong>IupGLLabel</strong> plus 
BORDERWIDTH.</p>


<h3><a name="SeeAlso">See Also</a></h3>


<p><a href="../elem/iupimage.html">IupImage</a>, <a href="iupgltoggle.html">IupGLToggle</a>,
<a href="iupgllabel.html">IupGLLabel</a></p>



</body>
</html>
